#pragma once

namespace sfv
{

		/**
		* \ingroup structural
		* \function igraph_betweenness
		* \brief Betweenness centrality of some vertices.
		* 
		* </para><para>
		* The betweenness centrality of a vertex is the number of geodesics
		* going through it. If there are more than one geodesic between two
		* vertices, the value of these geodesics are weighted by one over the 
		* number of geodesics.
		* \param graph The graph object.
		* \param res The result of the computation, a vector containing the
		*        betweenness scores for the specified vertices.
		* \param vids The vertices of which the betweenness centrality scores
		*        will be calculated.
		* \param directed Logical, if true directed paths will be considered
		*        for directed graphs. It is ignored for undirected graphs.
		* \return Error code:
		*        \c IGRAPH_ENOMEM, not enough memory for
		*        temporary data. 
		*        \c IGRAPH_EINVVID, invalid vertex id passed in
		*        \p vids. 
		*
		* Time complexity: O(|V||E|),
		* |V| and 
		* |E| are the number of vertices and
		* edges in the graph. 
		* Note that the time complexity is independent of the number of
		* vertices for which the score is calculated.
		*
		* \sa Other centrality types: \ref igraph_degree(), \ref igraph_closeness().
		*     See \ref igraph_edge_betweenness() for calculating the betweenness score
		*     of the edges in a graph. See \ref igraph_betweenness_estimate() to
		*     estimate the betweenness score of the vertices in a graph.
		*/
	    template< typename MatrixType, typename Array1, typename Array2 >
		int node_betweenness(const MatrixType& graph, Array1& res, const Array2& vids, int cutoff = -1 );

		/**
		* \ingroup structural
		* \function igraph_edge_betweenness
		* \brief Betweenness centrality of the edges.
		* 
		* </para><para>
		* The betweenness centrality of an edge is the number of geodesics
		* going through it. If there are more than one geodesics between two
		* vertices, the value of these geodesics are weighted by one over the 
		* number of geodesics.
		* \param graph The graph object.
		* \param result The result of the computation, vector containing the
		*        betweenness scores for the edges.
		* \param directed Logical, if true directed paths will be considered
		*        for directed graphs. It is ignored for undirected graphs.
		* \return Error code:
		*        \c IGRAPH_ENOMEM, not enough memory for
		*        temporary data. 
		*
		* Time complexity: O(|V||E|),
		* |V| and
		* |E| are the number of vertices and
		* edges in the graph. 
		*
		* \sa Other centrality types: \ref igraph_degree(), \ref igraph_closeness().
		*     See \ref igraph_edge_betweenness() for calculating the betweenness score
		*     of the edges in a graph. See \ref igraph_edge_betweenness_estimate() to
		*     estimate the betweenness score of the edges in a graph.
		*/
		template< typename MatrixType, typename Array >
		int edge_betweenness( const MatrixType& graph, Array& result, int cutoff = -1 ); 

} // end namespace sfv

#include <sfv/detail/centrality.inl>